import Http from '@/utils/axios'

/**
 * 获取群主ID
 * @param {String} groupId - 群组ID
 * @returns {Promise<Object>} 接口响应对象，包含 code, message, data
 */
export default {
  getGroupOwnerId(data) {
    return Http.get('/api/v1/user-list/group-owner', data)
  },
  /**
   * 获取群组成员列表
   * @param {Object} data - 请求参数
   * @param {String} data.groupId - 群组ID
   * @returns {Promise<Object>}
   */
  getGroupUsers(data) {
    return Http.get('/api/v1/user-list/group-users', data)
  },
  join(data) {
    return Http.post('/api/v1/user-list/join', data)
  },
  create(data) {
    return Http.post('/api/v1/user-list/create', data)
  },
  invite(data) {
    return Http.post('/api/v1/user-list/invite', data)
  },
  // 解散群聊
  disbandGroup(data) {
    return Http.post('/api/v1/user-list/disband', data)
  },
  exit(data) {
    return Http.post('/api/v1/user-list/exit', data)
  }
}
